package com.cs157a.view;

import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.border.TitledBorder;

import com.cs157a.controller.AposApplicationController;
import com.cs157a.dao.Radcrx;

public class PartNumberAssignmentPanel extends JPanel {

	private static final long serialVersionUID = 201211301L;
	private PartNumerSelectionPanel arsPanel;
	private PartNumerSelectionPanel behPanel;
	private PartNumerSelectionPanel danPanel;
	private PartNumerSelectionPanel modPanel;

	public PartNumberAssignmentPanel(AposApplicationController controller) {
		arsPanel = new PartNumerSelectionPanel(controller, VendorType.RDIM_ARS);
		behPanel = new PartNumerSelectionPanel(controller, VendorType.RDIM_BEH);
		danPanel = new PartNumerSelectionPanel(controller, VendorType.RDIM_DAN);
		modPanel = new PartNumerSelectionPanel(controller, VendorType.RDIM_MOD);

		setLayout(new GridLayout(1, 4));
		setBorder(new TitledBorder("Part Assignment"));
		add(arsPanel);
		add(behPanel);
		add(danPanel);
		add(modPanel);
	}

	public Radcrx getRadcrx() {
		// TODO Auto-generated method stub
		Radcrx radcrx = new Radcrx();
		arsPanel.updateRadcrx(radcrx);
		behPanel.updateRadcrx(radcrx);
		danPanel.updateRadcrx(radcrx);
		modPanel.updateRadcrx(radcrx);

		return radcrx;
	}

}
